package com.pj.hellomvvm.ui.adapter

import android.widget.ImageView
import coil.load
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.pj.hellomvvm.R
import com.pj.hellomvvm.entity.TitleIconData
import javax.inject.Inject


class TitleIconAdapter @Inject constructor() :
    BaseQuickAdapter<TitleIconData, BaseViewHolder>(R.layout.item_title_icon)  {
    override fun convert(holder: BaseViewHolder, item: TitleIconData) {
        holder.setText(R.id.item_title,item.title)
        var icon:ImageView = holder.getView(R.id.item_icon)
        icon.load(item.icon)
    }
}